const FontColorType = {
    'bold': ['\x1B[1m', '\x1B[22m'],
    'italic': ['\x1B[3m', '\x1B[23m'],
    'underline': ['\x1B[4m', '\x1B[24m'],
    'inverse': ['\x1B[7m', '\x1B[27m'],
    'strikethrough': ['\x1B[9m', '\x1B[29m'],
    'white': ['\x1B[37m', '\x1B[39m'],
    'grey': ['\x1B[90m', '\x1B[39m'],
    'black': ['\x1B[30m', '\x1B[39m'],
    'blue': ['\x1B[34m', '\x1B[39m'],
    'cyan': ['\x1B[36m', '\x1B[39m'],
    'green': ['\x1B[32m', '\x1B[39m'],
    'magenta': ['\x1B[35m', '\x1B[39m'],
    'red': ['\x1B[31m', '\x1B[39m'],
    'yellow': ['\x1B[33m', '\x1B[39m']
}


const logger = {
    info: (message?: any, ...optionalParams: any[]) => {
        if (optionalParams.length != 0) {
            console.info(`${FontColorType.white[0]}`, message, optionalParams,`${FontColorType.white[0]}`)
        } else {
            console.info(`${FontColorType.white[0]}`, message,`${FontColorType.white[0]}`);
        }
    },
    warn: (message?: any, ...optionalParams: any[]) => {
        if (optionalParams.length != 0) {
            console.info(`${FontColorType.yellow[0]}`, message, optionalParams,`${FontColorType.white[0]}`)
        } else {
            console.info(`${FontColorType.yellow[0]}`, message,`${FontColorType.white[0]}`);
        }
    },
    error: (message?: any, ...optionalParams: any[]) => {
        if (optionalParams.length != 0) {
            console.info(`${FontColorType.red[0]}`, message, optionalParams,`${FontColorType.white[0]}`)
        } else {
            console.info(`${FontColorType.red[0]}`, message,`${FontColorType.white[0]}`);
        }
    },
    debug: (message?: any, ...optionalParams: any[]) => {
        if (optionalParams.length != 0) {
            console.info(`${FontColorType.blue[0]}`, message, optionalParams,`${FontColorType.white[0]}`)
        } else {
            console.info(`${FontColorType.blue[0]}`, message,`${FontColorType.white[0]}`);
        }
    }
}

export default logger